<template>
	<view>
		
		<button @click="navigateToLocation">导航</button>
	</view>
</template>

<script>
	export default {
			data() {
				return {
					id:0, // 使用 marker点击事件 需要填写id
					title: 'map',
					latitude: 39.909,
					longitude: 116.39742,
					covers: [{
						latitude: 39.909,
						longitude: 116.39742,
						iconPath: '../../../static/location.png'
					}, {
						latitude: 39.90,
						longitude: 116.39,
						iconPath: '../../../static/location.png'
					}]
				}
			},
			methods:{
				 navigateToLocation() {
				      uni.openLocation({
				        latitude: 39.9042, // 目标地点的纬度，浮点数，范围为-90~90
				        longitude: 116.4074, // 目标地点的经度，浮点数，范围为-180~180
				        scale: 18, // 缩放比例，范围5~18
				        name: '目标位置', // 位置名
				        address: '目标详细地址', // 地址的详细说明
				        success() {
				          console.log('导航启动成功');
				        },
				        fail(error) {
				          console.log('导航启动失败', error);
				        }
				      });
				    }
			}
	}
</script>

<style lang="scss" scoped>
	 .page-section-gap{
		height: 90vh;
	}

</style>
